package com.lpit.zookeeper;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Data
@Configuration
@PropertySource("classpath:config/zookeeper.properties")//地址
@ConfigurationProperties(prefix = "zk")
public class ZkConfig {
    private String host;
    private String sequencePath;

    @Bean
    public ZooKeeperClient zooKeeperClient(){
        return new ZooKeeperClient(this.sequencePath, this.host);
    }

}
